package com.hjxr.xmgl.web.service.impl;

import java.util.List;
import com.hjxr.common.utils.DateUtils;
import com.hjxr.xmgl.web.domain.ProjectFeasibilityStudy;
import com.hjxr.xmgl.web.mapper.ProjectFeasibilityStudyMapper;
import com.hjxr.xmgl.web.service.IProjectFeasibilityStudyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 可行性研究报告Service业务层处理
 *
 * @author hjxr
 * @date 2021-12-02
 */
@Service
public class ProjectFeasibilityStudyServiceImpl implements IProjectFeasibilityStudyService
{
    @Autowired
    private ProjectFeasibilityStudyMapper projectFeasibilityStudyMapper;

    /**
     * 查询可行性研究报告
     *
     * @param projectId 可行性研究报告ID
     * @return 可行性研究报告
     */
    @Override
    public ProjectFeasibilityStudy selectProjectFeasibilityStudyById(String projectId)
    {
        return projectFeasibilityStudyMapper.selectProjectFeasibilityStudyById(projectId);
    }

    /**
     * 查询可行性研究报告列表
     *
     * @param projectFeasibilityStudy 可行性研究报告
     * @return 可行性研究报告
     */
    @Override
    public List<ProjectFeasibilityStudy> selectProjectFeasibilityStudyList(ProjectFeasibilityStudy projectFeasibilityStudy)
    {
        return projectFeasibilityStudyMapper.selectProjectFeasibilityStudyList(projectFeasibilityStudy);
    }

    /**
     * 新增可行性研究报告
     *
     * @param projectFeasibilityStudy 可行性研究报告
     * @return 结果
     */
    @Override
    public int insertProjectFeasibilityStudy(ProjectFeasibilityStudy projectFeasibilityStudy)
    {
        projectFeasibilityStudy.setCreateTime(DateUtils.getNowDate());
        return projectFeasibilityStudyMapper.insertProjectFeasibilityStudy(projectFeasibilityStudy);
    }

    /**
     * 修改可行性研究报告
     *
     * @param projectFeasibilityStudy 可行性研究报告
     * @return 结果
     */
    @Override
    public int updateProjectFeasibilityStudy(ProjectFeasibilityStudy projectFeasibilityStudy)
    {
        projectFeasibilityStudy.setUpdateTime(DateUtils.getNowDate());
        return projectFeasibilityStudyMapper.updateProjectFeasibilityStudy(projectFeasibilityStudy);
    }

    /**
     * 批量删除可行性研究报告
     *
     * @param projectIds 需要删除的可行性研究报告ID
     * @return 结果
     */
    @Override
    public int deleteProjectFeasibilityStudyByIds(String[] projectIds)
    {
        return projectFeasibilityStudyMapper.deleteProjectFeasibilityStudyByIds(projectIds);
    }

    /**
     * 删除可行性研究报告信息
     *
     * @param projectId 可行性研究报告ID
     * @return 结果
     */
    @Override
    public int deleteProjectFeasibilityStudyById(String projectId)
    {
        return projectFeasibilityStudyMapper.deleteProjectFeasibilityStudyById(projectId);
    }
}
